<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <title>CPack WIX Generator &mdash; CMake 4.1.1 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=a2c47e09" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css?v=4d06bd55" />
    
    <script src="../_static/documentation_options.js?v=e6a937a4"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    
    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMake Tutorial" href="../guide/tutorial/index.html" />
    <link rel="prev" title="CPack RPM Generator" href="rpm.html" />
 

  </head><body>
    <input id="sidebar-check" type="checkbox" />
    <label id="sidebar-overlay" for="sidebar-check"></label>



    <div class="related relbar1" role="navigation" aria-label="Related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../guide/tutorial/index.html" title="CMake Tutorial"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="rpm.html" title="CPack RPM Generator"
             accesskey="P">previous</a> |</li>
  <li>
    <label class="sidebar-toggle" for="sidebar-check"></label>
  </li>
  <li class="rootlink">
    <img src="../_static/cmake-logo-16.png" width="16" height="16" alt=""/>
    <a href="https://cmake.org/">CMake 4.1.1</a>
    <span class="reldelim1"> &#187;</span>
  </li>
  <li>
    <a href="../index.html">Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cpack-generators.7.html" accesskey="U">cpack-generators(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">CPack WIX Generator</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="cpack-wix-generator">
<span id="cpack_gen:CPack WIX Generator"></span><h1>CPack WIX Generator<a class="headerlink" href="#cpack-wix-generator" title="Link to this heading">¶</a></h1>
<p>Use the <a class="reference external" href="https://www.firegiant.com/wixtoolset/">WiX Toolset</a> to produce a Windows Installer <code class="docutils literal notranslate"><span class="pre">.msi</span></code> database.</p>
<div class="versionadded">
<p><span class="versionmodified added">Added in version 3.7: </span>The <span class="target" id="index-0-variable:CPACK_COMPONENT_&lt;compName&gt;_DISABLED"></span><a class="reference internal" href="../module/CPackComponent.html#variable:CPACK_COMPONENT_&lt;compName&gt;_DISABLED" title="CPACK_COMPONENT_&lt;compName&gt;_DISABLED"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_COMPONENT_&lt;compName&gt;_DISABLED</span></code></a> variable is now
supported.</p>
</div>
<section id="wix-toolsets">
<h2>WiX Toolsets<a class="headerlink" href="#wix-toolsets" title="Link to this heading">¶</a></h2>
<p>CPack selects one of the following variants of the WiX Toolset
based on the <span class="target" id="index-0-variable:CPACK_WIX_VERSION"></span><a class="reference internal" href="#variable:CPACK_WIX_VERSION" title="CPACK_WIX_VERSION"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_VERSION</span></code></a> variable:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#wix-net-tools">WiX .NET Tools</a></p></li>
<li><p><a class="reference internal" href="#wix-toolset-v3">WiX Toolset v3</a></p></li>
</ul>
<section id="wix-net-tools">
<h3>WiX .NET Tools<a class="headerlink" href="#wix-net-tools" title="Link to this heading">¶</a></h3>
<p>Packaging is performed using the following tools:</p>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">wix</span> <span class="pre">build</span></code></dt><dd><p>Build WiX source files directly into a Windows Installer <code class="docutils literal notranslate"><span class="pre">.msi</span></code> database.</p>
<p>Invocations may be customized using tool-specific variables:</p>
<ul class="simple">
<li><p><span class="target" id="index-0-variable:CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS"></span><a class="reference internal" href="#variable:CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS" title="CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_BUILD_EXTENSIONS</span></code></a></p></li>
<li><p><span class="target" id="index-0-variable:CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS"></span><a class="reference internal" href="#variable:CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS" title="CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_BUILD_EXTRA_FLAGS</span></code></a></p></li>
</ul>
</dd>
</dl>
<p>WiX extensions must be named with the form <code class="docutils literal notranslate"><span class="pre">WixToolset.&lt;Name&gt;.wixext</span></code>.</p>
<p>CPack expects the <code class="docutils literal notranslate"><span class="pre">wix</span></code> .NET tool to be available for command-line use
with any required WiX extensions already installed.  Be sure the <code class="docutils literal notranslate"><span class="pre">wix</span></code>
version is compatible with <span class="target" id="index-1-variable:CPACK_WIX_VERSION"></span><a class="reference internal" href="#variable:CPACK_WIX_VERSION" title="CPACK_WIX_VERSION"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_VERSION</span></code></a>, and that WiX
extension versions match the <code class="docutils literal notranslate"><span class="pre">wix</span></code> tool version.  For example:</p>
<ol class="arabic simple">
<li><p>Install the <code class="docutils literal notranslate"><span class="pre">wix</span></code> command-line tool using <code class="docutils literal notranslate"><span class="pre">dotnet</span></code>.</p></li>
</ol>
<blockquote>
<div><p>To install <code class="docutils literal notranslate"><span class="pre">wix</span></code> globally for the current user:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>dotnet tool install --global wix --version 4.0.4
</pre></div>
</div>
<p>This places <code class="docutils literal notranslate"><span class="pre">wix.exe</span></code> in <code class="docutils literal notranslate"><span class="pre">%USERPROFILE%\.dotnet\tools</span></code> and adds
the directory to the current user's <code class="docutils literal notranslate"><span class="pre">PATH</span></code> environment variable.</p>
<p>Or, to install <code class="docutils literal notranslate"><span class="pre">wix</span></code> in a specific path, e.g., in <code class="docutils literal notranslate"><span class="pre">c:\WiX</span></code>:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>dotnet tool install --tool-path c:\WiX wix --version 4.0.4
</pre></div>
</div>
<p>This places <code class="docutils literal notranslate"><span class="pre">wix.exe</span></code> in <code class="docutils literal notranslate"><span class="pre">c:\WiX</span></code>, but does <em>not</em> add it to the
current user's <code class="docutils literal notranslate"><span class="pre">PATH</span></code> environment variable.  The <code class="docutils literal notranslate"><span class="pre">WIX</span></code> environment
variable may be set to tell CPack where to find the tool,
e.g., <code class="docutils literal notranslate"><span class="pre">set</span> <span class="pre">WIX=c:\WiX</span></code>.</p>
</div></blockquote>
<ol class="arabic simple" start="2">
<li><p>Add the WiX <code class="docutils literal notranslate"><span class="pre">UI</span></code> extension, needed by CPack's default WiX template:</p></li>
</ol>
<blockquote>
<div><div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>wix extension add --global WixToolset.UI.wixext/4.0.4
</pre></div>
</div>
<p>Extensions added globally are stored in <code class="docutils literal notranslate"><span class="pre">%USERPROFILE%\.wix</span></code>, or if the
<code class="docutils literal notranslate"><span class="pre">WIX_EXTENSIONS</span></code> environment variable is set, in <code class="docutils literal notranslate"><span class="pre">%WIX_EXTENSIONS%\.wix</span></code>.</p>
</div></blockquote>
</section>
<section id="wix-toolset-v3">
<h3>WiX Toolset v3<a class="headerlink" href="#wix-toolset-v3" title="Link to this heading">¶</a></h3>
<p>Packaging is performed using the following tools:</p>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">candle</span></code></dt><dd><p>Compiles WiX source files into <code class="docutils literal notranslate"><span class="pre">.wixobj</span></code> files.</p>
<p>Invocations may be customized using tool-specific variables:</p>
<ul class="simple">
<li><p><span class="target" id="index-1-variable:CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS"></span><a class="reference internal" href="#variable:CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS" title="CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_CANDLE_EXTENSIONS</span></code></a></p></li>
<li><p><span class="target" id="index-1-variable:CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS"></span><a class="reference internal" href="#variable:CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS" title="CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_CANDLE_EXTRA_FLAGS</span></code></a></p></li>
</ul>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">light</span></code></dt><dd><p>Links <code class="docutils literal notranslate"><span class="pre">.wixobj</span></code> files into a Windows Installer <code class="docutils literal notranslate"><span class="pre">.msi</span></code> database.</p>
<p>Invocations may be customized using tool-specific variables:</p>
<ul class="simple">
<li><p><span class="target" id="index-2-variable:CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS"></span><a class="reference internal" href="#variable:CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS" title="CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_LIGHT_EXTENSIONS</span></code></a></p></li>
<li><p><span class="target" id="index-2-variable:CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS"></span><a class="reference internal" href="#variable:CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS" title="CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_LIGHT_EXTRA_FLAGS</span></code></a></p></li>
</ul>
</dd>
</dl>
<p>CPack invokes both tools as needed.  Intermediate <code class="docutils literal notranslate"><span class="pre">.wixobj</span></code> files
are considered implementation details.</p>
<p>WiX extensions must be named with the form <code class="docutils literal notranslate"><span class="pre">Wix&lt;Name&gt;Extension</span></code>.</p>
<p>CPack expects the above tools to be available for command-line
use via the <code class="docutils literal notranslate"><span class="pre">PATH</span></code>.  Or, if the <code class="docutils literal notranslate"><span class="pre">WIX</span></code> environment variable is set,
CPack looks for the tools in <code class="docutils literal notranslate"><span class="pre">%WIX%</span></code> and <code class="docutils literal notranslate"><span class="pre">%WIX%\bin</span></code>.</p>
</section>
</section>
<section id="variables-specific-to-cpack-wix-generator">
<h2>Variables specific to CPack WIX generator<a class="headerlink" href="#variables-specific-to-cpack-wix-generator" title="Link to this heading">¶</a></h2>
<p>The following variables are specific to the installers built on
Windows using WiX.</p>
<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_VERSION">
<span class="sig-name descname"><span class="pre">CPACK_WIX_VERSION</span></span><a class="headerlink" href="#variable:CPACK_WIX_VERSION" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.30.</span></p>
</div>
<p>Specify the version of WiX Toolset for which the configuration
is written.  The value must be one of</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">4</span></code></dt><dd><p>Package using <a class="reference internal" href="#wix-net-tools">WiX .NET Tools</a>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">3</span></code></dt><dd><p>Package using <a class="reference internal" href="#wix-toolset-v3">WiX Toolset v3</a>.  This is the default.</p>
</dd>
</dl>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_UPGRADE_GUID">
<span class="sig-name descname"><span class="pre">CPACK_WIX_UPGRADE_GUID</span></span><a class="headerlink" href="#variable:CPACK_WIX_UPGRADE_GUID" title="Link to this definition">¶</a></dt>
<dd><p>Upgrade GUID (<code class="docutils literal notranslate"><span class="pre">Product/&#64;UpgradeCode</span></code>)</p>
<p>Will be automatically generated unless explicitly provided.</p>
<p>It should be explicitly set to a constant generated globally unique
identifier (GUID) to allow your installers to replace existing
installations that use the same GUID.</p>
<p>You may for example explicitly set this variable in your
CMakeLists.txt to the value that has been generated per default.  You
should not use GUIDs that you did not generate yourself or which may
belong to other projects.</p>
<p>A GUID shall have the following fixed length syntax:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
</pre></div>
</div>
<p>(each X represents an uppercase hexadecimal digit)</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_PRODUCT_GUID">
<span class="sig-name descname"><span class="pre">CPACK_WIX_PRODUCT_GUID</span></span><a class="headerlink" href="#variable:CPACK_WIX_PRODUCT_GUID" title="Link to this definition">¶</a></dt>
<dd><p>Product GUID (<code class="docutils literal notranslate"><span class="pre">Product/&#64;Id</span></code>)</p>
<p>Will be automatically generated unless explicitly provided.</p>
<p>If explicitly provided this will set the Product Id of your installer.</p>
<p>The installer will abort if it detects a pre-existing installation that
uses the same GUID.</p>
<p>The GUID shall use the syntax described for CPACK_WIX_UPGRADE_GUID.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_LICENSE_RTF">
<span class="sig-name descname"><span class="pre">CPACK_WIX_LICENSE_RTF</span></span><a class="headerlink" href="#variable:CPACK_WIX_LICENSE_RTF" title="Link to this definition">¶</a></dt>
<dd><p>RTF License File</p>
<p>If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used as-is.</p>
<p>If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is implicitly
converted to RTF by the WIX Generator.
The expected encoding of the .txt file is UTF-8.</p>
<p>With CPACK_WIX_LICENSE_RTF you can override the license file used by the
WIX Generator in case CPACK_RESOURCE_FILE_LICENSE is in an unsupported
format or the .txt -&gt; .rtf conversion does not work as expected.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_PRODUCT_ICON">
<span class="sig-name descname"><span class="pre">CPACK_WIX_PRODUCT_ICON</span></span><a class="headerlink" href="#variable:CPACK_WIX_PRODUCT_ICON" title="Link to this definition">¶</a></dt>
<dd><p>The Icon shown next to the program name in Add/Remove programs.</p>
<p>If set, this icon is used in place of the default icon.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_UI_REF">
<span class="sig-name descname"><span class="pre">CPACK_WIX_UI_REF</span></span><a class="headerlink" href="#variable:CPACK_WIX_UI_REF" title="Link to this definition">¶</a></dt>
<dd><p>Specify the WiX <code class="docutils literal notranslate"><span class="pre">UI</span></code> extension's dialog set:</p>
<ul class="simple">
<li><p>With <a class="reference internal" href="#wix-net-tools">WiX .NET Tools</a>, this is the Id of the
<code class="docutils literal notranslate"><span class="pre">&lt;ui:WixUI&gt;</span></code> element in the default WiX template.</p></li>
<li><p>With <a class="reference internal" href="#wix-toolset-v3">WiX Toolset v3</a>, this is the Id of the
<code class="docutils literal notranslate"><span class="pre">&lt;UIRef&gt;</span></code> element in the default WiX template.</p></li>
</ul>
<p>The default is <code class="docutils literal notranslate"><span class="pre">WixUI_InstallDir</span></code> in case no CPack components have
been defined and <code class="docutils literal notranslate"><span class="pre">WixUI_FeatureTree</span></code> otherwise.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_UI_BANNER">
<span class="sig-name descname"><span class="pre">CPACK_WIX_UI_BANNER</span></span><a class="headerlink" href="#variable:CPACK_WIX_UI_BANNER" title="Link to this definition">¶</a></dt>
<dd><p>The bitmap will appear at the top of all installer pages other than the
welcome and completion dialogs.</p>
<p>If set, this image will replace the default banner image.</p>
<p>This image must be 493 by 58 pixels.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_UI_DIALOG">
<span class="sig-name descname"><span class="pre">CPACK_WIX_UI_DIALOG</span></span><a class="headerlink" href="#variable:CPACK_WIX_UI_DIALOG" title="Link to this definition">¶</a></dt>
<dd><p>Background bitmap used on the welcome and completion dialogs.</p>
<p>If this variable is set, the installer will replace the default dialog
image.</p>
<p>This image must be 493 by 312 pixels.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_PROGRAM_MENU_FOLDER">
<span class="sig-name descname"><span class="pre">CPACK_WIX_PROGRAM_MENU_FOLDER</span></span><a class="headerlink" href="#variable:CPACK_WIX_PROGRAM_MENU_FOLDER" title="Link to this definition">¶</a></dt>
<dd><p>Start menu folder name for launcher.</p>
<p>If this variable is not set, it will be initialized with CPACK_PACKAGE_NAME</p>
<div class="versionadded">
<p><span class="versionmodified added">Added in version 3.16: </span>If this variable is set to <code class="docutils literal notranslate"><span class="pre">.</span></code>, then application shortcuts will be
created directly in the start menu and the uninstaller shortcut will be
omitted.</p>
</div>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_CULTURES">
<span class="sig-name descname"><span class="pre">CPACK_WIX_CULTURES</span></span><a class="headerlink" href="#variable:CPACK_WIX_CULTURES" title="Link to this definition">¶</a></dt>
<dd><p>Language(s) of the installer</p>
<p>Languages are compiled into the Wix <code class="docutils literal notranslate"><span class="pre">UI</span></code> extension library.  To use them,
simply provide the name of the culture.  If you specify more than one
culture identifier in a comma or semicolon delimited list, the first one
that is found will be used.  You can find a list of supported languages at:
<a class="reference external" href="https://docs.firegiant.com/wix3/wixui/wixui_localization/">https://docs.firegiant.com/wix3/wixui/wixui_localization/</a></p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_TEMPLATE">
<span class="sig-name descname"><span class="pre">CPACK_WIX_TEMPLATE</span></span><a class="headerlink" href="#variable:CPACK_WIX_TEMPLATE" title="Link to this definition">¶</a></dt>
<dd><p>Template file for WiX generation</p>
<p>If this variable is set, the specified template will be used to generate
the WiX wxs file.  This should be used if further customization of the
output is required. The template contents will override the effect of most
<code class="docutils literal notranslate"><span class="pre">CPACK_WIX_</span></code> variables.</p>
<p>If this variable is not set, the default MSI template included with CMake
will be used.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_PATCH_FILE">
<span class="sig-name descname"><span class="pre">CPACK_WIX_PATCH_FILE</span></span><a class="headerlink" href="#variable:CPACK_WIX_PATCH_FILE" title="Link to this definition">¶</a></dt>
<dd><p>Optional list of XML files with fragments to be inserted into
generated WiX sources.</p>
<div class="versionadded">
<p><span class="versionmodified added">Added in version 3.5: </span>Support listing multiple patch files.</p>
</div>
<p>This optional variable can be used to specify an XML file that the
WIX generator will use to inject fragments into its generated
source files.</p>
<p>Patch files understood by the CPack WIX generator
roughly follow this RELAX NG compact schema:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>start = CPackWiXPatch

CPackWiXPatch = element CPackWiXPatch { CPackWiXFragment* }

CPackWiXFragment = element CPackWiXFragment
{
    attribute Id { string },
    fragmentContent*
}

fragmentContent = element * - CPackWiXFragment
{
    (attribute * { text } | text | fragmentContent)*
}
</pre></div>
</div>
<p>Currently fragments can be injected into most
Component, File, Directory and Feature elements.</p>
<div class="versionadded">
<p><span class="versionmodified added">Added in version 3.3: </span>The following additional special Ids can be used:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">#PRODUCT</span></code> for the <code class="docutils literal notranslate"><span class="pre">&lt;Product&gt;</span></code> element.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">#PRODUCTFEATURE</span></code> for the root <code class="docutils literal notranslate"><span class="pre">&lt;Feature&gt;</span></code> element.</p></li>
</ul>
</div>
<div class="versionadded">
<p><span class="versionmodified added">Added in version 3.7: </span>Support patching arbitrary <code class="docutils literal notranslate"><span class="pre">&lt;Feature&gt;</span></code> elements.</p>
</div>
<div class="versionadded">
<p><span class="versionmodified added">Added in version 3.9: </span>Allow setting additional attributes.</p>
</div>
<p>The following example illustrates how this works.</p>
<p>Given that the WIX generator creates the following XML element:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;Component</span><span class="w"> </span><span class="na">Id=</span><span class="s">&quot;CM_CP_applications.bin.my_libapp.exe&quot;</span><span class="w"> </span><span class="na">Guid=</span><span class="s">&quot;*&quot;</span><span class="nt">/&gt;</span>
</pre></div>
</div>
<p>The following XML patch file may be used to inject an Environment element
into it:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;CPackWiXPatch&gt;</span>
<span class="w">  </span><span class="nt">&lt;CPackWiXFragment</span><span class="w"> </span><span class="na">Id=</span><span class="s">&quot;CM_CP_applications.bin.my_libapp.exe&quot;</span><span class="nt">&gt;</span>
<span class="w">    </span><span class="nt">&lt;Environment</span><span class="w"> </span><span class="na">Id=</span><span class="s">&quot;MyEnvironment&quot;</span><span class="w"> </span><span class="na">Action=</span><span class="s">&quot;set&quot;</span>
<span class="w">      </span><span class="na">Name=</span><span class="s">&quot;MyVariableName&quot;</span><span class="w"> </span><span class="na">Value=</span><span class="s">&quot;MyVariableValue&quot;</span><span class="nt">/&gt;</span>
<span class="w">  </span><span class="nt">&lt;/CPackWiXFragment&gt;</span>
<span class="nt">&lt;/CPackWiXPatch&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_EXTRA_SOURCES">
<span class="sig-name descname"><span class="pre">CPACK_WIX_EXTRA_SOURCES</span></span><a class="headerlink" href="#variable:CPACK_WIX_EXTRA_SOURCES" title="Link to this definition">¶</a></dt>
<dd><p>Extra WiX source files</p>
<p>This variable provides an optional list of extra WiX source files (<code class="docutils literal notranslate"><span class="pre">.wxs</span></code>)
that should be compiled and linked.  The paths must be absolute.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_EXTRA_OBJECTS">
<span class="sig-name descname"><span class="pre">CPACK_WIX_EXTRA_OBJECTS</span></span><a class="headerlink" href="#variable:CPACK_WIX_EXTRA_OBJECTS" title="Link to this definition">¶</a></dt>
<dd><p>Extra WiX object files or libraries to use with <a class="reference internal" href="#wix-toolset-v3">WiX Toolset v3</a>.</p>
<p>This variable provides an optional list of extra WiX object (<code class="docutils literal notranslate"><span class="pre">.wixobj</span></code>)
and/or WiX library (<code class="docutils literal notranslate"><span class="pre">.wixlib</span></code>) files.  The paths must be absolute.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_EXTENSIONS">
<span class="sig-name descname"><span class="pre">CPACK_WIX_EXTENSIONS</span></span><a class="headerlink" href="#variable:CPACK_WIX_EXTENSIONS" title="Link to this definition">¶</a></dt>
<dd><p>Specify a list of additional extensions for WiX tools.
See <a class="reference internal" href="#wix-toolsets">WiX Toolsets</a> for extension naming patterns.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS">
<span class="sig-name descname"><span class="pre">CPACK_WIX_&lt;TOOL&gt;_EXTENSIONS</span></span><a class="headerlink" href="#variable:CPACK_WIX_<TOOL>_EXTENSIONS" title="Link to this definition">¶</a></dt>
<dd><p>Specify a list of additional extensions for a specific WiX tool.
See <a class="reference internal" href="#wix-toolsets">WiX Toolsets</a> for possible <code class="docutils literal notranslate"><span class="pre">&lt;TOOL&gt;</span></code> names.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS">
<span class="sig-name descname"><span class="pre">CPACK_WIX_&lt;TOOL&gt;_EXTRA_FLAGS</span></span><a class="headerlink" href="#variable:CPACK_WIX_<TOOL>_EXTRA_FLAGS" title="Link to this definition">¶</a></dt>
<dd><p>Specify a list of additional command-line flags for a specific WiX tool.
See <a class="reference internal" href="#wix-toolsets">WiX Toolsets</a> for possible <code class="docutils literal notranslate"><span class="pre">&lt;TOOL&gt;</span></code> names.</p>
<p>Use it at your own risk.
Future versions of CPack may generate flags which may be in conflict
with your own flags.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_CMAKE_PACKAGE_REGISTRY">
<span class="sig-name descname"><span class="pre">CPACK_WIX_CMAKE_PACKAGE_REGISTRY</span></span><a class="headerlink" href="#variable:CPACK_WIX_CMAKE_PACKAGE_REGISTRY" title="Link to this definition">¶</a></dt>
<dd><p>If this variable is set the generated installer will create
an entry in the windows registry key
<code class="docutils literal notranslate"><span class="pre">HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\&lt;PackageName&gt;</span></code>
The value for <code class="docutils literal notranslate"><span class="pre">&lt;PackageName&gt;</span></code> is provided by this variable.</p>
<p>Assuming you also install a CMake configuration file this will
allow other CMake projects to find your package with
the <span class="target" id="index-0-command:find_package"></span><a class="reference internal" href="../command/find_package.html#command:find_package" title="find_package"><code class="xref cmake cmake-command docutils literal notranslate"><span class="pre">find_package()</span></code></a> command.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_PROPERTY_&lt;PROPERTY&gt;">
<span class="sig-name descname"><span class="pre">CPACK_WIX_PROPERTY_&lt;PROPERTY&gt;</span></span><a class="headerlink" href="#variable:CPACK_WIX_PROPERTY_<PROPERTY>" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.1.</span></p>
</div>
<p>This variable can be used to provide a value for
the Windows Installer property <code class="docutils literal notranslate"><span class="pre">&lt;PROPERTY&gt;</span></code></p>
<p>The following list contains some example properties that can be used to
customize information under
&quot;Programs and Features&quot; (also known as &quot;Add or Remove Programs&quot;)</p>
<ul class="simple">
<li><p>ARPCOMMENTS - Comments</p></li>
<li><p>ARPHELPLINK - Help and support information URL</p></li>
<li><p>ARPURLINFOABOUT - General information URL</p></li>
<li><p>ARPURLUPDATEINFO - Update information URL</p></li>
<li><p>ARPHELPTELEPHONE - Help and support telephone number</p></li>
<li><p>ARPSIZE - Size (in kilobytes) of the application</p></li>
</ul>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_ROOT_FEATURE_TITLE">
<span class="sig-name descname"><span class="pre">CPACK_WIX_ROOT_FEATURE_TITLE</span></span><a class="headerlink" href="#variable:CPACK_WIX_ROOT_FEATURE_TITLE" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.7.</span></p>
</div>
<p>Sets the name of the root install feature in the WIX installer. Same as
CPACK_COMPONENT_&lt;compName&gt;_DISPLAY_NAME for components.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_ROOT_FEATURE_DESCRIPTION">
<span class="sig-name descname"><span class="pre">CPACK_WIX_ROOT_FEATURE_DESCRIPTION</span></span><a class="headerlink" href="#variable:CPACK_WIX_ROOT_FEATURE_DESCRIPTION" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.7.</span></p>
</div>
<p>Sets the description of the root install feature in the WIX installer. Same as
CPACK_COMPONENT_&lt;compName&gt;_DESCRIPTION for components.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_SKIP_PROGRAM_FOLDER">
<span class="sig-name descname"><span class="pre">CPACK_WIX_SKIP_PROGRAM_FOLDER</span></span><a class="headerlink" href="#variable:CPACK_WIX_SKIP_PROGRAM_FOLDER" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.7.</span></p>
</div>
<p>If this variable is set to true, the default install location
of the generated package will be CPACK_PACKAGE_INSTALL_DIRECTORY directly.
The install location will not be located relatively below
ProgramFiles or ProgramFiles64.</p>
<blockquote>
<div><div class="admonition note">
<p class="admonition-title">Note</p>
<p>Installers created with this feature do not take differences
between the system on which the installer is created
and the system on which the installer might be used into account.</p>
<p>It is therefore possible that the installer e.g. might try to install
onto a drive that is unavailable or unintended or a path that does not
follow the localization or convention of the system on which the
installation is performed.</p>
</div>
</div></blockquote>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_ROOT_FOLDER_ID">
<span class="sig-name descname"><span class="pre">CPACK_WIX_ROOT_FOLDER_ID</span></span><a class="headerlink" href="#variable:CPACK_WIX_ROOT_FOLDER_ID" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.9.</span></p>
</div>
<p>This variable allows specification of a custom root folder ID.
The generator specific <code class="docutils literal notranslate"><span class="pre">&lt;64&gt;</span></code> token can be used for
folder IDs that come in 32-bit and 64-bit variants.
In 32-bit builds the token will expand empty while in 64-bit builds
it will expand to <code class="docutils literal notranslate"><span class="pre">64</span></code>.</p>
<p>When unset generated installers will default installing to
<code class="docutils literal notranslate"><span class="pre">ProgramFiles&lt;64&gt;Folder</span></code>.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_ROOT">
<span class="sig-name descname"><span class="pre">CPACK_WIX_ROOT</span></span><a class="headerlink" href="#variable:CPACK_WIX_ROOT" title="Link to this definition">¶</a></dt>
<dd><p>This variable can optionally be set to the root directory
of a custom WiX Toolset installation.</p>
<p>When unspecified CPack will try to locate a WiX Toolset
installation via the <code class="docutils literal notranslate"><span class="pre">WIX</span></code> environment variable instead.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_CUSTOM_XMLNS">
<span class="sig-name descname"><span class="pre">CPACK_WIX_CUSTOM_XMLNS</span></span><a class="headerlink" href="#variable:CPACK_WIX_CUSTOM_XMLNS" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.19.</span></p>
</div>
<p>This variable provides a list of custom namespace declarations that are necessary
for using WiX extensions. Each declaration should be in the form name=url, where
name is the plain namespace without the usual xmlns: prefix and url is an unquoted
namespace url. A list of commonly known WiX schemata can be found here:
<a class="reference external" href="https://docs.firegiant.com/wix3/xsd/">https://docs.firegiant.com/wix3/xsd/</a></p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_SKIP_WIX_UI_EXTENSION">
<span class="sig-name descname"><span class="pre">CPACK_WIX_SKIP_WIX_UI_EXTENSION</span></span><a class="headerlink" href="#variable:CPACK_WIX_SKIP_WIX_UI_EXTENSION" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.23.</span></p>
</div>
<p>If this variable is set to true, the default inclusion of the WiX <code class="docutils literal notranslate"><span class="pre">UI</span></code>
extension is skipped, i.e., the <code class="docutils literal notranslate"><span class="pre">-ext</span> <span class="pre">WixUIExtension</span></code> or
<code class="docutils literal notranslate"><span class="pre">-ext</span> <span class="pre">WixToolset.UI.wixext</span></code> flag is not passed to WiX tools.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_ARCHITECTURE">
<span class="sig-name descname"><span class="pre">CPACK_WIX_ARCHITECTURE</span></span><a class="headerlink" href="#variable:CPACK_WIX_ARCHITECTURE" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.24.</span></p>
</div>
<p>This variable can be optionally set to specify the target architecture
of the installer. May for example be set to <code class="docutils literal notranslate"><span class="pre">x64</span></code> or <code class="docutils literal notranslate"><span class="pre">arm64</span></code>.</p>
<p>When unspecified, CPack will default to <code class="docutils literal notranslate"><span class="pre">x64</span></code> or <code class="docutils literal notranslate"><span class="pre">x86</span></code>.</p>
</dd></dl>

<dl class="cmake variable">
<dt class="sig sig-object cmake" id="variable:CPACK_WIX_INSTALL_SCOPE">
<span class="sig-name descname"><span class="pre">CPACK_WIX_INSTALL_SCOPE</span></span><a class="headerlink" href="#variable:CPACK_WIX_INSTALL_SCOPE" title="Link to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 3.29.</span></p>
</div>
<p>This variable can be optionally set to specify the <code class="docutils literal notranslate"><span class="pre">InstallScope</span></code>
of the installer:</p>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">perMachine</span></code></dt><dd><p>Create an installer that installs for all users and requires
administrative privileges.  Start menu entries created by the
installer are visible to all users.</p>
<p>This is the default.  See policy <span class="target" id="index-0-policy:CMP0172"></span><a class="reference internal" href="../policy/CMP0172.html#policy:CMP0172" title="CMP0172"><code class="xref cmake cmake-policy docutils literal notranslate"><span class="pre">CMP0172</span></code></a>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">perUser</span></code></dt><dd><p>Not yet supported. This is reserved for future use.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">NONE</span></code></dt><dd><p>Create an installer without any <code class="docutils literal notranslate"><span class="pre">InstallScope</span></code> attribute.</p>
<p>This is supported only if <span class="target" id="index-2-variable:CPACK_WIX_VERSION"></span><a class="reference internal" href="#variable:CPACK_WIX_VERSION" title="CPACK_WIX_VERSION"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CPACK_WIX_VERSION</span></code></a> is not set,
or is set to <code class="docutils literal notranslate"><span class="pre">3</span></code>.</p>
<div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 3.29: </span>This value is only for compatibility with the inconsistent behavior used
by CPack 3.28 and older.  The resulting installer requires administrative
privileges and installs into the system-wide <code class="docutils literal notranslate"><span class="pre">ProgramFiles</span></code> directory,
but the start menu entry and uninstaller registration are created only
for the current user.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>An installation performed by an installer created without any
<code class="docutils literal notranslate"><span class="pre">InstallScope</span></code> cannot be cleanly updated or replaced by an
installer with an <code class="docutils literal notranslate"><span class="pre">InstallScope</span></code>.  In order to transition
a project's installers from <code class="docutils literal notranslate"><span class="pre">NONE</span></code> to <code class="docutils literal notranslate"><span class="pre">perMachine</span></code>, the
latter installer should be distributed with instructions to
first manually uninstall any older version.</p>
</div>
</dd>
</dl>
<p>See <a class="reference external" href="https://docs.firegiant.com/wix3/xsd/wix/package/">https://docs.firegiant.com/wix3/xsd/wix/package/</a></p>
</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
  <div>
    <h3>Table of Contents</h3>
    <ul>
<li><a class="reference internal" href="#">CPack WIX Generator</a><ul>
<li><a class="reference internal" href="#wix-toolsets">WiX Toolsets</a><ul>
<li><a class="reference internal" href="#wix-net-tools">WiX .NET Tools</a></li>
<li><a class="reference internal" href="#wix-toolset-v3">WiX Toolset v3</a></li>
</ul>
</li>
<li><a class="reference internal" href="#variables-specific-to-cpack-wix-generator">Variables specific to CPack WIX generator</a></li>
</ul>
</li>
</ul>

  </div>
  <div>
    <h4>Previous topic</h4>
    <p class="topless"><a href="rpm.html"
                          title="previous chapter">CPack RPM Generator</a></p>
  </div>
  <div>
    <h4>Next topic</h4>
    <p class="topless"><a href="../guide/tutorial/index.html"
                          title="next chapter">CMake Tutorial</a></p>
  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/cpack_gen/wix.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="Related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../guide/tutorial/index.html" title="CMake Tutorial"
             >next</a> |</li>
        <li class="right" >
          <a href="rpm.html" title="CPack RPM Generator"
             >previous</a> |</li>
  <li>
    <label class="sidebar-toggle" for="sidebar-check"></label>
  </li>
  <li class="rootlink">
    <img src="../_static/cmake-logo-16.png" width="16" height="16" alt=""/>
    <a href="https://cmake.org/">CMake 4.1.1</a>
    <span class="reldelim1"> &#187;</span>
  </li>
  <li>
    <a href="../index.html">Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cpack-generators.7.html" >cpack-generators(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">CPack WIX Generator</a></li> 
      </ul>
    </div>

    <div class="footer" role="contentinfo">
    &#169; Copyright 2000-2025 Kitware, Inc. and Contributors.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
    </div>
<script type="text/javascript">
(function() {
  "use strict";
  const hide = () => document.getElementById("sidebar-check").checked = false;
  addEventListener("keydown", e => (e.key === "Escape") && hide());
  addEventListener("click", e => (e.target.tagName === "A") && hide());
  addEventListener("hashchange", hide)
})();
</script>
  </body>
</html>